<?php
/**
 * 会员中心——账户概览
 *
 *
 *
 * * @网店运维 (c) 2015-2018  Inc. (http://www.shopwwi.com)
 * @license    http://www.shopwwi.c om
 * @link       交流群号：111731672
 * @since      网店运维提供技术支持 授权请购买shopnc授权
 */



defined('InShopNC') or exit('Access Invalid!');

class memberControl extends BaseMemberControl{

    /**
     * 我的商城
     */
    public function homeOp() {
        $model_consume = Model('consume');
        $consume_list = $model_consume->getConsumeList(array('member_id' => $_SESSION['member_id']), '*', 0, 10);
        Tpl::output('consume_list', $consume_list);
        Tpl::showpage('member_home');
    }

    /*
    public function transOp(){
        $model_member = Model("member");
        $data = array('member_type'=>2,'member_name'=>array('notlike','JYC%'));
        //$member_count = $model_member->getMemberCount($data);
        $member_list = $model_member->getMemberList($data);
        $NumberLogic = Logic("number");
        foreach($member_list as $member){
            $user_id = substr(date('Ym',strtotime('-1 month')),1,5).sprintf("%06s",$member['member_id']);
            $user_code = $NumberLogic->encodeNum($user_id);
            $user_name = "JYC".substr($user_code,1);
            $model_member->editMember(array('member_id'=>$member['member_id']),array('member_name'=>$user_name));
        }
        echo "Success";
    }


    public function uploadmemberOp(){
        $model_member = Model("member");
        $data = array("member_type"=>2);
        $member_list = $model_member->getMemberList($data,"*",10000,"member_id asc");

        foreach($member_list as $member){
          $sql = "INSERT INTO ucenter.uc_members SET usertype='".$member['member_type']."',username='".$member['member_name']."',nickname='".$member['member_nickname']."',truename='".$member['member_truename']."',password='".$member['member_passwd']."',salt='".substr($member['member_passwd'],-6)."',email='".$member['member_email']."',mobile='".$member['member_mobile']."',regdate='".$member['member_time']."',regip='".$member['member_login_ip']."',lastloginip='".$member['member_old_login_ip']."',qq_openid='".$member['member_qqopenid']."',qq_info='".$member['member_qqinfo']."',sina_openid='".$member['member_sinaopenid']."',sina_info='".$member['member_sinainfo']."',weixin_unionid='".$member['weixin_unionid']."',weixin_info='".$member['weixin_info']."'";
          $result =  DB::execute($sql);
        }
        echo "Success";
    }
   */
}
